###############################################################################
#    KShootout - online shootout card game.                                   #
#    Copyright (C) 2008, 2009  MacJariel                                      #
#                                                                             #
#    KShootout is free software: you can redistribute it and/or modify        #
#    it under the terms of the GNU General Public License as published by     #
#    the Free Software Foundation, either version 3 of the License, or        #
#    (at your option) any later version.                                      #
#                                                                             #
#    KShootout is distributed in the hope that it will be useful,             #
#    but WITHOUT ANY WARRANTY; without even the implied warranty of           #
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
#    GNU General Public License for more details.                             #
#                                                                             #
#    You should have received a copy of the GNU General Public License        #
#    along with KShootout.  If not, see <http://www.gnu.org/licenses/>.       #
###############################################################################
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

SET(common_SRCS
        config.cpp
        gameevents.cpp
        gametypes.cpp
        queries.cpp
        stringconverter.cpp
        util.cpp
        debug/debugblock.cpp
        parser/actionparser.cpp
        parser/gameeventparser.cpp
        parser/gamestructparser.cpp
        parser/ioproxy.cpp
        parser/parser.cpp
        parser/querygetparser.cpp
        parser/servereventparser.cpp
        parser/xmlnode.cpp
)

SET(common_COG
        actions.h
        gameevents.h
        gametypes.h
        gamestructs.h
        serverevents.h
        parser/actionparser.cpp
        parser/actionparser.h
        parser/gameeventparser.h
        parser/gameeventparser.cpp
        parser/gamestructparser.h
        parser/gamestructparser.cpp
        parser/servereventparser.cpp
        parser/servereventparser.h
)

SET(common_MOC
        parser/parser.h
        parser/ioproxy.h
        parser/xmlnode.h
)

SET(COG_COMMAND cog.py)
SET(COG_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/../cog)

ADD_CUSTOM_TARGET(Cog ALL ${COG_COMMAND} -r -I ${COG_INCLUDE} ${common_COG}
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

QT4_WRAP_CPP(common_MOC_SRCS ${common_MOC})

ADD_LIBRARY(kshootout-common ${common_SRCS} ${common_MOC_SRCS})

